<#setting number_format = "#"/>
<style type="text/css">@import url( ${contextPath}/templates/${templateName}/styles/style.css?${startupTime} );</style>

<table width="100%" align="center" cellpadding="4" cellspacing="1" border="0" class="forumline">
	<tr>
		<td class="cathead" colspan="8" align="center" height="28"><span class="cattitle">${I18n.getMessage("AdminAttachments.addNew")}</span></td>
	</tr>
	
	<form accept-charset="${encoding}" name="form" action="${contextPath}/jforum${extension}" method="post">
	<input type="hidden" name="action" value="extensionGroupsSave" />
	<input type="hidden" name="module" value="${moduleName}" />

	<tr>
		<th class="thleft">&nbsp;${I18n.getMessage("AdminAttachments.extensionGroup")}&nbsp;</th>
		<th>&nbsp;${I18n.getMessage("AdminAttachments.allowed")}&nbsp;</th>
		<th>&nbsp;${I18n.getMessage("AdminAttachments.downloadMode")}&nbsp;</th>
		<th colspan="2">&nbsp;${I18n.getMessage("AdminAttachments.uploadIcon")}&nbsp;</th>
	</tr>

	<tr>
		<td class="row1" align="center" valign="middle">
			<table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
				<tr>
					<td class="row1" align="center" valign="middle" width="10%" wrap="nowrap">&nbsp;</td>
					<td class="row1" align="left" valign="middle"><input type="text" size="20" maxlength="100" name="name" value="" /></td>
				</tr>
			</table>
		</td>

		<td class="row1" align="center" valign="middle"><input type="checkbox" name="allow" /></td>

		<td class="row2" align="center" valign="middle">
			<select name="download_mode">
				<option value="1" selected>${I18n.getMessage("AdminAttachments.inline")}</option>
				<option value="2">${I18n.getMessage("AdminAttachments.physical")}</option>
			</select>
		</td>

		<td colspan="2" class="row1" align="center" valign="middle"><input type="text" size="30" name="upload_icon" /></td>
	</tr>

	<tr align="right">
	  <td class="catbottom" colspan="8" height="29"><input type="submit" name="submit" class="liteoption" value="${I18n.getMessage("submit")}" /></td>
    </tr>
	</form>

	<tr><td colspan="8">&nbsp;</td></tr>

	<!-- Edit -->
	<tr>
		<td class="cathead" colspan="8" align="center" height="28"><span class="cattitle">${I18n.getMessage("AdminAttachments.existing")}</span></td>
	</tr>

	<#if (groups.size() > 0)>
		<form accept-charset="${encoding}" name="form" action="${contextPath}/jforum${extension}" method="post">
		<input type="hidden" name="action" value="extensionGroupsUpdate" />
		<input type="hidden" name="module" value="${moduleName}" />
		<input type="hidden" name="total_records" value="${groups.size()}"/>

		<tr>
			<th class="thleft">&nbsp;${I18n.getMessage("AdminAttachments.extensionGroup")}&nbsp;</th>
			<th>&nbsp;${I18n.getMessage("AdminAttachments.allowed")}&nbsp;</th>
			<th>&nbsp;${I18n.getMessage("AdminAttachments.downloadMode")}&nbsp;</th>
			<th>&nbsp;${I18n.getMessage("AdminAttachments.uploadIcon")}&nbsp;</th>
			<th>&nbsp;${I18n.getMessage("AdminAttachments.quotaDelete")}&nbsp;</th>
		</tr>

		<#assign counter = 0/>
		<#list groups as g>
			<input type="hidden" name="id_${counter}" value="${g.id}"/>
			<tr>
				<td class="row1" align="center" valign="middle">
					<table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
						<tr>
							<td class="row1" align="center" valign="middle" width="10%" wrap="nowrap">&nbsp;</td>
							<td class="row1" align="left" valign="middle"><input type="text" size="20" maxlength="100" name="name_${counter}" value="${g.name}" /></td>
						</tr>
					</table>
				</td>

				<td class="row1" align="center" valign="middle"><input type="checkbox" name="allow_${counter}" <#if g.isAllow()>checked</#if> /></td>
				<td class="row2" align="center" valign="middle">
					<select name="download_mode_${counter}">
						<option value="1" <#if g.downloadMode == 1>selected</#if>>${I18n.getMessage("AdminAttachments.inline")}</option>
						<option value="2" <#if g.downloadMode == 2>selected</#if>>${I18n.getMessage("AdminAttachments.physical")}</option>
					</select>
				</td>
				<td class="row1" align="center" valign="middle"><input type="text" size="30" name="upload_icon_${counter}" value="${g.uploadIcon?default("")}"/></td>
				<td class="row1" align="center" valign="middle"><input type="checkbox" name="delete" value="${g.id}"/></td>
			</tr>
			<#assign counter = counter + 1/>
		</#list>

		<tr align="right">
		  <td class="catbottom" colspan="8" height="29"><input type="submit" name="submit" class="liteoption" value="${I18n.getMessage("submit")}" /></td>
		</tr>
		</form>
	</#if>
</table>
